from django.urls import re_path, path, include
from rest_framework import routers
from . import views, query

router = routers.DefaultRouter()
router.register(r"paycode", views.paycode, basename="00扫码页面")
router.register(r"pay", views.PaycodeManualPage, basename="01测试支付")

router.register(r"activepay", views.ActivePayViewSet, basename="111主扫收款")
router.register(r"activepayV2", views.ActivePayViewSetV2, basename="112主扫收款V2")
router.register(r"sweptpay", views.SweptPayViewSet, basename="121被扫收款")
router.register(r"sweptpayV2", views.SweptPayViewSetV2, basename="122被扫收款V2")

router.register(r"transquery", views.TransQueryViewSet, basename="13交易查询")
router.register(r"alert", views.alert, basename="141交易结果通知")
router.register(r"alertv2", views.alertV2, basename="142交易结果通知V2")

router.register(r"cancel", views.CancelOrderViewSet, basename="15撤销交易")
router.register(r"return", views.ReturnOrderViewSet, basename="16退款交易")

router.register(r"queryint", query.AllinpayQueryInListViewSet, basename="20收单查询")
router.register(r"queryout", query.AllinpayQueryOutListViewSet, basename="21退单查询")
router.register(r"queryreqsn", query.AllinpaySettlementReqstViewSet, basename="22结算请求")
router.register(r"queryvlid", query.AllinpaySettlementVlidViewSet, basename="23结算审核")
router.register(r"querybank", query.AllinpayPayBankViewSet, basename="24结算打款")

router.register(r"storedReqsn", views.PlaceStoredReqsnViewSet, basename="30场所储值订单")
router.register(r"storedPay", views.PlaceStoredPayViewSet, basename="31场所储值支付")
# router.register(r'test', views.test, basename='03测试')
urlpatterns = [
    # path('paycode/', views.paycode.as_view({'get':'retrieve'}), name='FE扫码页面'),
    # path('alert/', views.alert.as_view(), name='接收消息通知'),
    path("", include(router.urls)),
]
